package net.htjs.juc.thread;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadSleep {

    public static void main(String[] args) {
        Thread thread = new Thread(() ->{
            try {
                Thread.sleep(2000);
                log.info("running");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "Thread-1");
        log.info("运行前线程状态:{}", thread.getState());
        thread.start();
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("运行后线程状态:{}", thread.getState());
    }


}
